package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.dao.PaymentDAO;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.IPaymentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Author YanJingren
 * @Date 2021/2/23
 * @Description com.atguigu.springcloud.service.impl
 */
@Service("paymentService")
public class PaymentServiceImpl implements IPaymentService {

    @Resource
    private PaymentDAO paymentDAO;

    @Override
    @Transactional
    public int create(Payment payment) {
        return paymentDAO.create(payment);
    }

    @Override
    public Payment getPaymentById(Long id) {
        return paymentDAO.getPaymentById(id);
    }
}
